package pokerbot.entities;

import pokerbot.Constants.Suit;
import pokerbot.Constants.Value;

public class Card {
    
    private final Suit suit;
    private final Value value;

    public Card(Suit suit, Value value) {
        this.suit = suit;
        this.value = value;
    }
    
    public Suit getSuit() {
        return suit;
    }

    public Value getValue() {
        return value;
    }

    @Override
    public String toString() {
        return new StringBuilder(value.toString())
                .append(" of ").append(suit).toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Card) {
            Card card = (Card) obj;
            if (card.getSuit() == this.suit && card.getValue() == this.value) {
                return true;
            }
        }
        return false;
    }

}
